home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / RIncludes / SIOW.r < prev    next >
Encoding:
Text File  |  1995-08-05  |  8.7 KB  |  443 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Input/Output Window
  6. #
  7. #    SIOW
  8. #
  9. #    Copyright:    © 1989-1993 by Apple Computer, Inc., all rights reserved.
  10. #
  11. ------------------------------------------------------------------------------*/
  12.  
  13. #include "systypes.r"
  14. #include "types.r"
  15.  
  16. #include "SIOW.h"
  17.  
  18. #ifndef CREATOR
  19.     #define CREATOR 'siow'
  20. #endif
  21.  
  22. #ifndef FCREATOR
  23.     #define FCREATOR 'MPS '
  24. #endif
  25.  
  26. #ifndef WINDOW_HEIGTH
  27.     #define WINDOW_HEIGTH 286
  28. #endif
  29.  
  30. #ifndef WINDOW_WIDTH
  31.     #define WINDOW_WIDTH 480
  32. #endif
  33.  
  34.  
  35. type 'pzza' {
  36.     literal longint;
  37. };
  38.  
  39. resource 'pzza' (128, purgeable) {
  40.     FCREATOR;
  41. };
  42.  
  43. /* we use an MBAR resource to conveniently load all the menus */
  44.  
  45. resource 'MBAR' (__rMenuBar, preload) {
  46.     { __mApple, __mFile, __mEdit, __mFont /*, __mSize */};        /* five menus */
  47. };
  48.  
  49.  
  50. resource 'MENU' (__mApple, preload) {
  51.     __mApple, textMenuProc,
  52.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  53.     enabled, apple,
  54.     {
  55.         "About S I O W\311",
  56.             noicon, nokey, nomark, plain;
  57.         "-",
  58.             noicon, nokey, nomark, plain
  59.     }
  60. };
  61.  
  62. resource 'MENU' (__mFile, preload) {
  63.     __mFile, textMenuProc,
  64.     0b000000000000000000000000000000,    /* enable Quit only, program enables others */
  65.     enabled, "File",
  66.     {
  67.         "New",
  68.             noicon, "N", nomark, plain;
  69.         "Open",
  70.             noicon, "O", nomark, plain;
  71.         "-",
  72.             noicon, nokey, nomark, plain;
  73.         "Close",
  74.             noicon, "W", nomark, plain;
  75.         "Save",
  76.             noicon, "S", nomark, plain;
  77.         "Save As\311",
  78.             noicon, nokey, nomark, plain;
  79.         "-",
  80.             noicon, nokey, nomark, plain;
  81.         "Page Setup\311",
  82.             noicon, nokey, nomark, plain;
  83. // 12/13/93 - Added Command-P equivalent to Print item
  84.         "Print\311",
  85.             noicon, "P", nomark, plain;
  86.         "-",
  87.             noicon, nokey, nomark, plain;
  88.         "Quit",
  89.             noicon, "Q", nomark, plain
  90.     }
  91. };
  92.  
  93. resource 'MENU' (__mEdit, preload) {
  94.     __mEdit, textMenuProc,
  95.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  96.     enabled, "Edit",
  97.      {
  98.         "Undo",
  99.             noicon, "Z", nomark, plain;
  100.         "-",
  101.             noicon, nokey, nomark, plain;
  102.         "Cut",
  103.             noicon, "X", nomark, plain;
  104.         "Copy",
  105.             noicon, "C", nomark, plain;
  106.         "Paste",
  107.             noicon, "V", nomark, plain;
  108.         "Clear",
  109.             noicon, nokey, nomark, plain
  110.     }
  111. };
  112.  
  113. resource 'MENU' (__mFont, preload) {
  114.     __mFont, textMenuProc,
  115.     0b1111111111111111111111111111111,    /* enable everything */
  116.     enabled, "Font",
  117.      {
  118.      }
  119. };
  120.  
  121. /* this ALRT and DITL are used as an About screen */
  122.  
  123. resource 'ALRT' (__rAboutAlert, purgeable) {
  124. // 12/13/93 - GAB: support for native PowerPC version
  125. #ifdef APPNAME    // taller dialog for PowerPC version
  126.     {66, 58, 354, 396},
  127. #else
  128.     {66, 58, 344, 396},
  129. #endif
  130.      __rAboutAlert, {
  131.         OK, visible, silent;
  132.         OK, visible, silent;
  133.         OK, visible, silent;
  134.         OK, visible, silent
  135.     }
  136.     /*    The following are window positioning options ,usable in 7.0    */
  137. #if SystemSevenOrLater
  138.     , centerParentWindowScreen
  139. #endif
  140.     ;
  141. };
  142.  
  143. resource 'DITL' (__rAboutAlert, purgeable) {
  144.     {    /* array DITLarray: 10 elements */
  145.         /* [1] */
  146. // 12/13/93 - GAB: support for native PowerPC version
  147. #ifdef APPNAME    // taller dialog for PowerPC version
  148.         {260, 129, 280, 209},
  149. #else
  150.         {233, 144, 253, 224},
  151. #endif
  152.         Button {
  153.             enabled,
  154.             "OK"
  155.         },
  156.         /* [2] */
  157.         {8, 72, 23, 264},
  158.         StaticText {
  159.             disabled,
  160.             "Simple Input/Output Window"
  161.         },
  162.         /* [3] */
  163.         {56, 24, 71, 337},
  164.         StaticText {
  165.             disabled,
  166.             $$Format("Copyright ©Apple Computer, Inc. 1989-%d ", $$Year)
  167.         },
  168.         /* [4] */
  169.         {80, 108, 96, 244},
  170.         StaticText {
  171.             disabled,
  172.             "Brought to you by..."
  173.         },
  174.         /* [5] */
  175.         {109, 132, 134, 229},
  176.         StaticText {
  177.             disabled,
  178.             "\"PZZA SLT\""
  179.         },
  180.         /* [6] */
  181.         {152, 24, 170, 212},
  182.         StaticText {
  183.             disabled,
  184.             "Special Thanks to..."
  185.         },
  186.         /* [7] */
  187.         {176, 56, 194, 289},
  188.         StaticText {
  189.             disabled,
  190.             "Roger, Russ, Landon, Ira & Munch"
  191.         },
  192. // 12/13/93 - GAB: support for native PowerPC version
  193. #ifdef APPNAME    // for native PowerPC build only
  194.         /* [8] */
  195.         {200, 24, 218, 212},
  196.         StaticText {
  197.             disabled,
  198.             "PowerPC port by…"
  199.         },
  200.         /* [9] */
  201.         {224, 56, 242, 289},
  202.         StaticText {
  203.             disabled,
  204.             "Greg Branche"
  205.         },
  206. #endif
  207.         /* [10] */
  208.         {32, 152, 47, 200},
  209.         StaticText {
  210.             disabled,
  211.             "(SIOW)"
  212.         }
  213.     }
  214. };
  215.  
  216. /* this ALRT and DITL are used as an error screen */
  217.  
  218. resource 'ALRT' (__rUserAlert, purgeable) {
  219.     {40, 20, 150, 260},
  220.     __rUserAlert,
  221.     { /* array: 4 elements */
  222.         /* [1] */
  223.         OK, visible, silent,
  224.         /* [2] */
  225.         OK, visible, silent,
  226.         /* [3] */
  227.         OK, visible, silent,
  228.         /* [4] */
  229.         OK, visible, silent
  230.     }
  231. #if SystemSevenOrLater
  232.     , alertPositionParentWindowScreen
  233. #endif
  234. };
  235.  
  236.  
  237. resource 'DITL' (__rUserAlert, purgeable) {
  238.     { /* array DITLarray: 3 elements */
  239.         /* [1] */
  240.         {80, 150, 100, 230},
  241.         Button {
  242.             enabled,
  243.             "OK"
  244.         },
  245.         /* [2] */
  246.         {10, 60, 60, 230},
  247.         StaticText {
  248.             disabled,
  249.             "Error. ^0."
  250.         },
  251.         /* [3] */
  252.         {8, 8, 40, 40},
  253.         Icon {
  254.             disabled,
  255.             2
  256.         }
  257.     }
  258. };
  259.  
  260.  
  261. resource 'WIND' (__rDocWindow, preload, purgeable) {
  262.     {0, 0, WINDOW_HEIGTH, WINDOW_WIDTH},
  263.     zoomDocProc, invisible, noGoAway, 0x0, "untitled"
  264.     /*    The following are window positioning options ,usable in 7.0    */
  265. #if SystemSevenOrLater
  266.     , noAutoCenter
  267. #endif
  268. };
  269.  
  270. resource 'CNTL' (__rVScroll, preload, purgeable) {
  271.     {-1, WINDOW_WIDTH-15, WINDOW_HEIGTH-14, WINDOW_WIDTH+1},
  272.     0, invisible, 0, 0, scrollBarProc, 0, ""
  273. };
  274.  
  275. resource 'CNTL' (__rHScroll, preload, purgeable) {
  276.     {WINDOW_HEIGTH-15, -1, WINDOW_HEIGTH+1, WINDOW_WIDTH-14},
  277.     0, invisible, 0, 0, scrollBarProc, 0, ""
  278. };
  279.  
  280. resource 'STR#' (__kErrStrings, purgeable) {
  281.     {
  282.     "You must run on 512Ke or later";
  283.     "Application Memory Size is too small";
  284.     "Not enough memory to run SIOW";
  285.     "Not enough memory to do Cut";
  286.     "Cannot do Cut";
  287.     "Cannot do Copy";
  288.     "Cannot exceed 32,000 characters with Paste";
  289.     "Not enough memory to do Paste";
  290.     "Cannot create window";
  291.     "Cannot exceed 32,000 characters";
  292.     "Cannot do Paste";
  293.     "Font not found";
  294.     "Cannot exceed request count during input - text truncated"
  295.     }
  296. };
  297.  
  298. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  299.  
  300. resource 'SIZE' (-1) {
  301.     dontSaveScreen,
  302.     acceptSuspendResumeEvents,
  303.     enableOptionSwitch,
  304.     canBackground,                /* we can background; we don't currently, but our sleep value */
  305.                                 /* guarantees we don't hog the Mac while we are in the background */
  306.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  307.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  308.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  309.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  310.     is32BitCompatible,            /* this app should not be run in 32-bit address space */
  311.     reserved,
  312.     reserved,
  313.     reserved,
  314.     reserved,
  315.     reserved,
  316.     reserved,
  317.     reserved,
  318.     __kPrefSize * 1024,
  319.     __kMinSize * 1024    
  320. };
  321.  
  322.  
  323. type CREATOR as 'STR ';
  324.  
  325.  
  326. resource CREATOR (0) {
  327.     "MultiFinder-Aware Simple Input/Output Window (SIOW)"
  328. };
  329.  
  330.  
  331. resource 'BNDL' (128) {
  332.     CREATOR,
  333.     0,
  334.     {
  335.         'ICN#',
  336.         {
  337.             0, 128
  338.         },
  339.         'FREF',
  340.         {
  341.             0, 128
  342.         }
  343.     }
  344. };
  345.  
  346.  
  347. resource 'FREF' (128) {
  348.     'APPL',
  349.     0,
  350.     ""
  351. };
  352.  
  353.  
  354. resource 'ICN#' (128) {
  355.     {    /* array: 2 elements */
  356.         /* [1] */
  357.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  358.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  359.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  360.         $"00FF FF00 03FF FFE0 0791 03F0 0ED1 0E7C"
  361.         $"1C31 321C 380D C10E 3FFF FFFE 3003 C106"
  362.         $"380D 300E 1E31 0E3C 1FC1 01F8 07FF FFE0"
  363.         $"00FF FE00",
  364.         /* [2] */
  365.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  366.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  367.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  368.         $"00FF FF00 03FF FFE0 07FF FFF0 0FFF FFFC"
  369.         $"1FFF FFFC 3FFF FFFE 3FFF FFFE 3FFF FFFE"
  370.         $"3FFF FFFE 1FFF FFFC 1FFF FFF8 07FF FFE0"
  371.         $"00FF FE00"
  372.     }
  373. };
  374.  
  375. resource 'ALRT' (__rSaveAlert, preload) {
  376.     {72, 64, 212, 372},
  377.     __rSaveAlert,
  378.     {    /* array: 4 elements */
  379.         /* [1] */
  380.         OK, visible, silent,
  381.         /* [2] */
  382.         OK, visible, silent,
  383.         /* [3] */
  384.         OK, visible, silent,
  385.         /* [4] */
  386.         OK, visible, silent
  387.     }
  388.     /*    The following are window positioning options ,usable in 7.0    */
  389. #if SystemSevenOrLater
  390.     , alertPositionParentWindowScreen
  391. #endif
  392.     ;
  393. };
  394.  
  395. resource 'DITL' (__rSaveAlert, preload) {
  396.     {    /* array DITLarray: 4 elements */
  397.         /* [1] */
  398.         {58, 25, 76, 99},
  399.         Button {
  400.             enabled,
  401.             "Yes"
  402.         },
  403.         /* [2] */
  404.         {86, 25, 104, 99},
  405.         Button {
  406.             enabled,
  407.             "No"
  408.         },
  409.         /* [3] */
  410.         {12, 20, 45, 277},
  411.         StaticText {
  412.             disabled,
  413.             "Save changes before closing?"
  414.         },
  415.         /* [4] */
  416.         {86, 195, 104, 269},
  417.         Button {
  418.             enabled,
  419.             "Cancel"
  420.         }
  421.     }
  422. };
  423.  
  424.  
  425. // 12/13/93 - GAB: Support for native PowerPC version
  426.  
  427. #ifdef APPNAME    // only include 'cfrg' in native PowerPC apps
  428.  
  429. #include "CodeFragmentTypes.r"
  430.  
  431. resource 'cfrg' (0) {
  432.     {
  433.         kPowerPC,
  434.         kFullLib,
  435.         kNoVersionNum,kNoVersionNum,
  436.         0,0,
  437.         kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork,
  438.         APPNAME    // must be defined on Rez command line with -d option
  439.     }
  440. };
  441.  
  442. #endif
  443.